#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
	for (int i = 0; i < numsSize; i++) {
		if (nums[abs(nums[i]) - 1] > 0)
			nums[abs(nums[i]) - 1] = -(nums[abs(nums[i]) - 1]);
	} int* ret = (int*)malloc(sizeof(int) * (numsSize));
	*returnSize = 0;
	for (int i = 0; i < numsSize; i++) {
		if (nums[i] > 0) {
			ret[*returnSize] = i + 1;
			*returnSize += 1;
		}
	} return ret;
}

int main()
{
	srand((unsigned int)time(NULL));
	int arr[10] = { 0 };
	for (int i = 0; i < 10; i++)
	{
		arr[i] = rand() % 10;
	}
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
	int ab = 0;
	int* a = findDisappearedNumbers(arr, 10,&ab );
	int i = 0;
	while(a[i] < 10)
	{			
		printf("%d ", a[i++]);
	}
}